Skip to content

Conversation

@archandatta
Copy link
Contributor

@archandatta archandatta commented Dec 19, 2025

Note

Implements Chrome enterprise policy–based extension installation and updates runtime flags handling.

  • Policy: add ExtensionInstallForcelist, switch ExtensionSettings to use update_url, and add ExtractExtensionIDFromUpdateXML; AddExtension now uses Chrome extension ID (from update.xml) and maintains the forcelist
  • API: during upload, detect extensions needing policy, validate presence/parsability of update.xml and a .crx, and call updated policy API; only add --load-extension flags for non-policy extensions
  • Server: serve update.xml/.crx via new HTTP routes (/extensions/*, /update.xml, /{filename}.crx) so Chrome can fetch them
  • Docker: make /chromium/flags bind mount writable
  • Tests: remove obsolete Web Bot Auth policy test

Written by Cursor Bugbot for commit 058a6aa. This will update automatically on new commits. Configure here.

@archandatta archandatta force-pushed the archand/kernel-726/fix-web-bot-auth-extension branch from de5debc to 1af7c34 Compare January 7, 2026 15:46
@archandatta archandatta marked this pull request as ready for review January 7, 2026 16:08
@archandatta archandatta requested a review from rgarcia January 7, 2026 17:20
@archandatta archandatta force-pushed the archand/kernel-726/fix-web-bot-auth-extension branch from 1af7c34 to f9e1cee Compare January 9, 2026 18:22
Copy link
Contributor

@rgarcia rgarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good progress on the Chrome enterprise policy implementation. The core logic for separating policy vs non-policy extensions looks solid.

Main concern: the deleted TestWebBotAuthInstallation test should be updated rather than removed - the new flow has significant behavior changes that warrant e2e coverage.

A few minor nits on style/perf, and a question about whether the /update.xml root route is necessary.


// Try to extract Chrome extension ID from update.xml
chromeExtensionID := extensionName
extractionErr := error(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: var extractionErr error is more idiomatic


// Serve update.xml at root for Chrome enterprise policy
// This serves the first update.xml found in any extension directory
r.Get("/update.xml", func(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this serves the first update.xml found based on directory iteration order, which isn't deterministic. if there are multiple extensions with update.xml files, this could return the wrong one. is this route needed given /extensions/{name}/update.xml already works via the wildcard route above?

// Filter out entries that start with the same extension ID
extensionIDPrefix := chromeExtensionID + ";"
policy.ExtensionInstallForcelist = slices.DeleteFunc(policy.ExtensionInstallForcelist, func(entry string) bool {
return len(entry) >= len(extensionIDPrefix) && entry[:len(extensionIDPrefix)] == extensionIDPrefix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: strings.HasPrefix(entry, extensionIDPrefix) would be cleaner here

return "", fmt.Errorf("appid attribute is empty in update.xml")
}

// Validate extension ID format: Chrome extension IDs are 32 lowercase hex characters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: comment says "hex" but Chrome extension IDs use a-p (a base16 variant), not 0-9a-f. maybe "32 lowercase a-p characters" to match the regex


// Validate extension ID format: Chrome extension IDs are 32 lowercase hex characters
// This prevents injection attacks via semicolons or other special characters
if !regexp.MustCompile(`^[a-p]{32}$`).MatchString(appID) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this compiles the regex on every call. could move to a package-level var extensionIDRegex = regexp.MustCompile(...)

return targets, nil
}

func TestWebBotAuthInstallation(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test was verifying the web-bot-auth policy installation flow. rather than deleting it, could we update it to test the new behavior? the new flow (requiring update.xml + .crx, ExtensionInstallForcelist, update_url instead of path) seems important enough to have e2e coverage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants